package ma.ac.onousc.gestionfi.EngagementPaiement.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;


@Entity
@NamedQuery(name = "TypeEngagement.findByTypeEngagement", query = "select tp from TypePrestation tp where tp.typeEngagement=:te")
public class TypePrestation implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int idTypePrestation;
	private String intituleTypePrestation;

	@OneToMany(mappedBy = "typePrestation")
	private List<Prestation> prestation;
	
	@ManyToOne
	private TypeEngagement typeEngagement;

	public TypePrestation(String intituleTypePrestation) {
		super();
		this.intituleTypePrestation = intituleTypePrestation;
	}

	public TypePrestation() {
		super();
	}

	public int getIdTypePrestation() {
		return idTypePrestation;
	}

	public void setIdTypePrestation(int idTypePrestation) {
		this.idTypePrestation = idTypePrestation;
	}

	public String getIntituleTypePrestation() {
		return intituleTypePrestation;
	}

	public void setIntituleTypePrestation(String intituleTypePrestation) {
		this.intituleTypePrestation = intituleTypePrestation;
	}

	public List<Prestation> getPrestation() {
		return prestation;
	}

	public void setPrestation(List<Prestation> prestation) {
		this.prestation = prestation;
	}

	public TypeEngagement getTypeEngagement() {
		return typeEngagement;
	}

	public void setTypeEngagement(TypeEngagement typeEngagement) {
		this.typeEngagement = typeEngagement;
	}
	

}
